package com.easylinkin.linkappapi.ruleengine.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.easylinkin.linkappapi.ruleengine.entity.RuleEngine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 智能规则引擎 Mapper 接口
 * </p>
 *
 * @author TongJie
 * @since 2020-08-24
 */
public interface RuleEngineMapper extends BaseMapper<RuleEngine> {

    List<RuleEngine> getRuleEngines(@Param("ruleEngine") RuleEngine ruleEngine, @Param("spacesIds") List<String> spacesIds);

    IPage<RuleEngine> getRuleEngines(@Param("page") Page page, @Param("ruleEngine") RuleEngine ruleEngine, @Param("spacesIds") List<String> spacesIds);

    int batchInsert(@Param("list") List<RuleEngine> list);

    List<RuleEngine> getRuleEnginesExistsDeviceCode(@Param("ruleEngine") RuleEngine ruleEngine, @Param("deviceCode") String deviceCode, @Param("spacesIds") List<String> spacesIds);
}
